package cn.diancan.util;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

/**
 * 基础类型对象工具
 * @author Sky 
 */
public class ObjectUtils {
    
    
    public static boolean isNotBlank(Object data){ 
	return !isBlank(data);
    }
    
    @SuppressWarnings("rawtypes")
    public static boolean isBlank(Object data){
	if(null == data ){
	    return true;
	}  
	if(data instanceof String){
	    return StringUtils.isBlank(data.toString());
	}else if(data instanceof Collection){  
	    Collection collection = (Collection)data;
	    return collection.size()<=0;
	}else if(data instanceof Map){
	    Map map= (Map)data;
	    return map.size()<=0;
	}if(data instanceof Integer){
	    int value = (Integer)data;
	    return value==0;
	}else if(data instanceof Long){
	    Long value = (Long)data;
	    return value==0;
	}else if(data instanceof Double){
	    Double value = (Double)data;
	    return value==0;
	}else if(data instanceof Float){
	    Float value = (Float)data;
	    return value==0;
	}
	
	return false;
    }
    
    public static void main(String[] args) {
	double i=-0.000000;
	System.out.println( isBlank(i));
    }

}
